package exception;

public class ThrowDemo {
    public static void main(String[] args) {
        Person p = new Person();
        try {
            p.setAge(1000);//满足语法，但不满足实际业务需求；隐式抛出
        } catch (IllegalAgeException e) {
            throw new RuntimeException(e);
        }
        System.out.println("此人年龄："+p.getAge());
    }
}
